package com.gljx.web.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.gljx.web.Entity.SubjectThreeNo;
import com.gljx.web.dao.CommonDao;
import com.gljx.web.dao.SubjectThreeNoMapper;
import com.gljx.web.service.SubjectThreeNoService;
@Service
@Transactional
public class SubjectThreeNoServiceImpl extends CommonDao implements SubjectThreeNoService {
	
	@Autowired
	private SubjectThreeNoMapper subjectThreeNoMapper;
	
	@Override
	public Map<String, Object> selectPageCount(String psql) {
		// TODO Auto-generated method stub
		Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("Psql", psql);
        paramMap.put("Pcount", oracle.jdbc.OracleTypes.INTEGER);
        this.getSqlSession().select("com.gljx.web.dao.SubjectThreeNoMapper.pagecount", paramMap, null);
        return paramMap;
	}

	@Override
	public Map<String, Object> selectPage(int pindex, String psql, int psize) {
		// TODO Auto-generated method stub
		Map<String, Object> paramMap = new HashMap<String, Object>();
        paramMap.put("Pindex", pindex);
        paramMap.put("Psql", psql);
        paramMap.put("Psize", psize);
        paramMap.put("Pcount", oracle.jdbc.OracleTypes.INTEGER);
        paramMap.put("v_cur", oracle.jdbc.OracleTypes.CURSOR);
        this.getSqlSession().select("com.gljx.web.dao.SubjectThreeNoMapper.pagemap", paramMap, null);
        return paramMap;
	}

	@Override
	public int addSubjectThreeNo(SubjectThreeNo subjectThreeNo) {
		// TODO Auto-generated method stub
		return subjectThreeNoMapper.insertSelective(subjectThreeNo);
	}

	@Override
	public int deleteSubjectThreeNoByFid(String fid) {
		// TODO Auto-generated method stub
		return subjectThreeNoMapper.deleteByPrimaryKey(fid);
	}

	@Override
	public SubjectThreeNo selSubjectThreeNoByFid(String fid) {
		// TODO Auto-generated method stub
		return subjectThreeNoMapper.selectByPrimaryKey(fid);
	}

	@Override
	public int updateSubjectThreeNoByFid(SubjectThreeNo subjectThreeNo) {
		// TODO Auto-generated method stub
		return subjectThreeNoMapper.updateByPrimaryKeySelective(subjectThreeNo);
	}

	@Override
	public List<SubjectThreeNo> selectSubjectThreeNoExcel(String cfxh, String cfStudentName, String beginTime, String endTime, String fcompanyid) {
		Map<String, String> map = new HashMap<>();
		map.put("cfxh", cfxh);
		map.put("cfStudentName", cfStudentName);
		map.put("beginTime", beginTime);
		map.put("endTime", endTime);
		map.put("cfficompanyid", fcompanyid);
		return subjectThreeNoMapper.selectSubjectThreeNoExcel(map);
	}
}
